package Homework;

import java.util.Scanner;

/**
 * @program: Java_Study
 * @author: Xiaofan
 * @createTime: 2021-07-07 10:09
 * @description: Functions of this class is 矩阵运算
 **/
public class A3 {
    public static void main(String args[]){
        Scanner scanner=new Scanner(System.in);
        while (scanner.hasNext()){
            int x=scanner.nextInt();
            int n=scanner.nextInt();
            int m=scanner.nextInt();
            int k=scanner.nextInt();
            int s1[][]=new int[n][m];
            int s2[][]=new int[m][k];
            for(int i=0;i<n;i++){
                for(int j=0;j<m;j++){
                    s1[i][j]=scanner.nextInt();
                }
            }
            for(int i=0;i<m;i++){
                for(int j=0;j<k;j++){
                    s2[i][j]=scanner.nextInt();
                }
            }
            print(n,m,k,s1,s2);
        }
    }
    private static void print(int n,int m,int k,int s1[][],int s2[][]){
        int ans[][]=new int[n][k];
        for(int i=0;i<n;i++){
            for(int j=0;j<k;j++){
                for(int K=0;K<m;K++){
                    ans[i][j]+=s1[i][K]*s2[K][j];
                }
            }
        }
        for(int i=0;i<n;i++){
            for(int j=0;j<k;j++){
                System.out.print(ans[i][j]+" ");
            }
            System.out.println();
        }
    }
}